package dialer.ws.base.entity;

import java.io.Serializable;
import java.sql.Time;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "campaign_entry", schema = "call_center")
public class CampaignEntry implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1820582887551860953L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false)
	private Integer id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_form")
	private Form form;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_queue_call_entry", nullable = false)
	private QueueCallEntry queueCallEntry;
	
	@Column(name = "name", nullable = false)
	private String name;
	
	@Column(name = "datetime_init", nullable = false)
	private Date datetimeInit;
	
	@Column(name = "datetime_end", nullable = false)
	private Date datetimeEnd;
	
	@Column(name = "daytime_init", nullable = false)
	private Time daytimeInit;
	
	@Column(name = "daytime_end", nullable = false)
	private Time daytimeEnd;
	
	@Column(name = "estatus", nullable = false, length = 1)
	private String estatus;
	
	@Column(name = "script", nullable = false, length = 65535)
	private String script;
	
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "campaignEntry")
	private List<CallEntry> listCallEntry;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Form getForm() {
		return form;
	}

	public void setForm(Form form) {
		this.form = form;
	}

	public QueueCallEntry getQueueCallEntry() {
		return queueCallEntry;
	}

	public void setQueueCallEntry(QueueCallEntry queueCallEntry) {
		this.queueCallEntry = queueCallEntry;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Date getDatetimeInit() {
		return datetimeInit;
	}

	public void setDatetimeInit(Date datetimeInit) {
		this.datetimeInit = datetimeInit;
	}

	public Date getDatetimeEnd() {
		return datetimeEnd;
	}

	public void setDatetimeEnd(Date datetimeEnd) {
		this.datetimeEnd = datetimeEnd;
	}

	public Time getDaytimeInit() {
		return daytimeInit;
	}

	public void setDaytimeInit(Time daytimeInit) {
		this.daytimeInit = daytimeInit;
	}

	public Time getDaytimeEnd() {
		return daytimeEnd;
	}

	public void setDaytimeEnd(Time daytimeEnd) {
		this.daytimeEnd = daytimeEnd;
	}

	public String getEstatus() {
		return estatus;
	}

	public void setEstatus(String estatus) {
		this.estatus = estatus;
	}

	public String getScript() {
		return script;
	}

	public void setScript(String script) {
		this.script = script;
	}

	public List<CallEntry> getListCallEntry() {
		return listCallEntry;
	}

	public void setListCallEntry(List<CallEntry> listCallEntry) {
		this.listCallEntry = listCallEntry;
	}
}
